#include<bits/stdc++.h>
#define MAX 505
#define ll long long
using namespace std;
const ll mod=1e9+7;
ll dp[MAX][MAX][2],n,k;
bool ck[MAX][MAX]; 
char s[MAX];
int main(){
	freopen("bracket.in","r",stdin);
	freopen("bracket.out","w",stdout);
	scanf("%lld%lld",&n,&k);
	scanf("%s",s+1);
	for(int i=1;i<=n;i++){
		if(s[i]=='*'||s[i]=='?') ck[i][i]=1;
		for(int j=i+1;j<=n;j++)
			if(ck[i][j-1]&&(s[j]=='*'||s[j]=='?')) ck[i][j]=1;
	}
	for(int i=1;i<=n;i++)
		for(int j=i-1;j>=0;j--) ck[i][j]=1; 
	for(int len=2;len<=n;len++)
		for(int i=1,j;i+len-1<=n;i++){
			j=i+len-1;
			if(s[i]=='*'||s[i]==')'||s[j]=='*'||s[j]=='(') continue;
			for(int t=i+1;t<j&&t-i<=k&&ck[i+1][t];t++)
				dp[i][j][0]=(dp[i][j][0]+dp[t+1][j-1][0]+dp[t+1][j-1][1])%mod;
			for(int t=j-1;t>i&&j-t<=k&&ck[t][j-1];t--)
				dp[i][j][0]=(dp[i][j][0]+dp[i+1][t-1][0]+dp[i+1][t-1][1])%mod;
			if((j-1>=i+1||i+1==j)&&ck[i+1][j-1]&&(j-1-(i+1)+1)<=k) dp[i][j][0]=(dp[i][j][0]+1+mod)%mod;
			dp[i][j][0]=(dp[i][j][0]+dp[i+1][j-1][0]+dp[i+1][j-1][1])%mod;
			for(int t=i+1;t<j;t++){
				dp[i][j][1]=(dp[i][j][1]+dp[i][t][0]*(dp[t+1][j][0]+dp[t+1][j][1])%mod)%mod; 
			}
			ll sum=0,head=i+2,tail=head-1;
			for(int t=i+1;t<j;t++){
				while(ck[head][tail+1]&&(tail+1)-head+1<=k){
					tail++;
					if(tail>=head) sum=(sum+dp[tail+1][j][0]+dp[tail+1][j][1])%mod;
				}
				dp[i][j][1]=(dp[i][j][1]+dp[i][t][0]*sum%mod)%mod;
				if(tail>=head)
					sum=(sum-dp[head+1][j][0]-dp[head+1][j][1]+2*mod)%mod;
				head++;
			}
		}
	printf("%lld",(dp[1][n][0]+dp[1][n][1])%mod);
}
